import Vue from 'vue';
import App from './App.vue';
import router from './router';
import ElementUI from 'element-ui';
import VueParticles from 'vue-particles';
import axios from 'axios';
import 'xe-utils';
import VXETable from 'vxe-table';
import 'vxe-table/lib/style.css';
import 'element-ui/lib/theme-chalk/index.css'; // 默认主题
// import './assets/css/theme-green/index.css'; // 浅绿色主题
import './assets/css/icon.css';
import 'babel-polyfill';


Vue.config.productionTip = false;
Vue.use(ElementUI, {
    size: 'small'
});
Vue.use(VueParticles);
Vue.prototype.$axios = axios;
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
// axios.defaults.baseURL = '/api'
Vue.use(VXETable);

// router.beforeEach((to, from, next) => {
//     document.title = `${to.meta.title} | Agriculture-manage-system`;
//     let role = sessionStorage.getItem("role")
//     if (!role) {
//         role = 'watcher'
//     }
//     if (role && to.meta.roles.includes(role)) {
//         next(); //放行
//     } else if (to.path == "/404") {
//         next();
//     } else {
//         next({ path: "/no_permission" }); //跳到404页面
//     }
// });

new Vue({
    router,
    render: h => h(App)
}).$mount('#app');